package com.github.server.interfaces;

import com.github.livebase.util.base.ObjectsUtil;

import java.util.Set;

/**
 * @ClassName HttpRequest
 * @description:
 * @author: biao532
 * @create: 2024-01-31 22:08
 * @Version 1.0
 **/
public interface HttpRequest {
    String getHeader(String key);
    default String getHeaderOrDefault(String key, String defVal) {
        return ObjectsUtil.getOrDefault(getHeader(key), defVal);
    }
    String getPath();

    String getParameter(String key);
    default String getParameterOrDefault(String key, String defVal) {
        return ObjectsUtil.getOrDefault(getParameter(key), defVal);
    }
    String getMethod();

    Set<String> parameterKeySet();
}
